package com.tuo51.observation.domain;

import com.tuo51.foudation.model.Domain;
import com.tuo51.observation.vo.observation.ObservationOptionVO;
import com.vladmihalcea.hibernate.type.json.JsonStringType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;

@Entity
@Table(name = "ob_point")
@Data
@EqualsAndHashCode(callSuper = true)
@TypeDef(name = "json", typeClass = JsonStringType.class)
public class ObservatePoint extends Domain {

    @Column(columnDefinition = "varchar(50) COMMENT '能区id' ")
    private String dimensionId;

    @Column(columnDefinition = "varchar(50) COMMENT '能区名字' ")
    private String dimensionName;

    @Column(columnDefinition = "int default 0 COMMENT '月龄'")
    private Integer month = 0;

    @Column(columnDefinition = "int default 0 COMMENT '序号'")
    private Integer indexOnPaper = 0;

    @Column(columnDefinition = "varchar(50) COMMENT '标题' ")
    private String title;

    @Column(columnDefinition = "varchar(40) COMMENT '道具' ")
    private String tools;

    @Column(columnDefinition = "varchar(500) COMMENT '活动内容' ")
    private String activity;

    @Column(columnDefinition = "varchar(500) COMMENT '观察内容' ")
    private String observation;

    @Column(columnDefinition = " bit DEFAULT 0 COMMENT '高级选项' ")
    private Boolean advance = false;

    @Type(type = "json")
    @Column(columnDefinition = "JSON COMMENT '选项：名称，分值，对应分值跳过的题目' ")
    private List<ObservationOptionVO> options;

}
